package fileContent;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class Demo11 {
    public static void main(String[] args) {
        try(InputStream inputStream=new FileInputStream("./test.txt")) {
            //缓冲区
            byte[] buffer=new byte[1024];
            //len表示读取到的字节数
            //如果读取到-1，表示读取完毕
            int len = inputStream.read(buffer);
            for (int i = 0; i < len; i++) {
                System.out.printf("0x%x\n",buffer[i]);
            }
        }catch (IOException e){
            e.printStackTrace();
        }

    }

}